//
//  MyaccountView.m
//  Sunexpress
//
//  Created by 筱亮 on 2017/5/9.
//  Copyright © 2017年 曹亮. All rights reserved.
//

#import "MyaccountView.h"
#import <SDAutoLayout.h>
@implementation MyaccountView


-(instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        
        [self addSubview:self.pohoneNumber];
        
        [self addSubview:self.password];
        
        [self addSubview:self.loginBtn];
        
        [self addSubview:self.retrievePasswordBtn];
        
        
        self.pohoneNumber.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self,10).
        topSpaceToView(self,120).
        heightIs(50);
        
        
        self.password.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self,10).
        topSpaceToView(self.pohoneNumber,2).
        heightIs(50);
        
        self.loginBtn.sd_layout.
        leftSpaceToView(self,10).
        rightSpaceToView(self,10).
        topSpaceToView(self.password,40).
        heightIs(55);
        
        self.retrievePasswordBtn.sd_layout.
        rightSpaceToView(self,20).
        topSpaceToView(self.loginBtn,30).
        heightIs(15).widthIs(70);

    }
    return  self;
}

-(UITextField*)pohoneNumber
{
    if (!_pohoneNumber) {
        _pohoneNumber = [[UITextField alloc]init];
        _pohoneNumber.placeholder = @"  请输入手机号";
        _pohoneNumber.font=[UIFont systemFontOfSize:20];
        _pohoneNumber.backgroundColor = [UIColor whiteColor];
        _pohoneNumber.layer.masksToBounds=YES;
        _pohoneNumber.layer.cornerRadius=8;
    }
    return _pohoneNumber;
}

-(UITextField*)password
{
    if (!_password) {
        _password = [[UITextField alloc]init];
        _password.placeholder = @"   6-20位密码";
        _password.secureTextEntry = YES;
        _password.font = [UIFont systemFontOfSize:20];
        _password.backgroundColor = [UIColor whiteColor];
        _password.layer.masksToBounds=YES;
        _password.layer.cornerRadius=8;
    }
    return _password;
}

-(UIButton*)loginBtn
{
    if (!_loginBtn) {
        _loginBtn = [[UIButton alloc]init];
        [_loginBtn setTitle:@"登录" forState:0];
        _loginBtn.titleLabel.font = [UIFont systemFontOfSize:20];
        _loginBtn.layer.cornerRadius = 7;
        _loginBtn.layer.masksToBounds = YES;
        _loginBtn.backgroundColor = [UIColor orangeColor];
        
    }
    return _loginBtn;
}

-(UIButton*)retrievePasswordBtn
{
    if (!_retrievePasswordBtn) {
        _retrievePasswordBtn = [[UIButton alloc]init];
        [_retrievePasswordBtn setTitle:@"找回密码" forState:0];
        
        _retrievePasswordBtn.titleLabel.font = [UIFont systemFontOfSize: 14.0];
        [_retrievePasswordBtn setTitleColor:[UIColor colorWithWhite:0.218 alpha:1.000] forState:UIControlStateNormal];

    }
    return _retrievePasswordBtn;
}

@end
